#include <iostream>
#include <signal.h>
#include <unistd.h>


void handler(int sig)
{
    std::cout << "Received signal " << sig << std::endl;
}

int main()
{
    signal(2, handler); // ignore SIGINT
    int cnt = 0;
    while(1)
    {
        std::cout << "Hello world, " << cnt++ << ", pid: " << getpid() <<std::endl;
        sleep(1);
    }
    return 0;
}